package net.stogi.common.gwt.dispatch.client.core.impl;

import net.stogi.common.gwt.dispatch.client.core.ActionManager;
import net.stogi.common.gwt.dispatch.client.core.DispatchService;
import net.stogi.common.gwt.dispatch.client.core.DispatchServiceAsync;
import net.stogi.common.gwt.dispatch.shared.core.Action;
import net.stogi.common.gwt.dispatch.shared.core.Result;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class ActionManagerImpl implements ActionManager {

	private DispatchServiceAsync dispatchService = GWT.create(DispatchService.class);

	@Override
	public <A extends Action<R>, R extends Result> void execute(A action, AsyncCallback<R> callback) {
		dispatchService.execute(action, callback);
	}
}
